<!DOCTYPE html>
<?php
	include_once("header.php");
	include_once("bottom.php");
	include_once("../manager/ThesisManager.php");
	include_once("../manager/CommentManager.php");
	include_once("../manager/DescriptionManager.php");
	$thesis_name = $_REQUEST['thesis_name'];
	$thesis_value = ThesisManager::getInstance()->getValueByThesisname($thesis_name);
	$comment_values = CommentManager::getInstance()->getValueByThesisname($thesis_name);
	$description = DescriptionManager::getInstance()->getValueByThesisname($thesis_name);
?>
<html lang="zh-hk">
<head>

	<title>Tiny bOOk</title>
	
	<meta http-equiv="Content-Type" content="text/html charset=UTF-8">
	<meta name="description" content="在这里你可以看到最新发布的书籍，和好友共享对某本书的评论和笔记">
	<meta http-equiv="imagetoolbar" content="no">
	<meta name="viewport" content="width=1036">
	
	<link rel="stylesheet" type="text/css" href="../css/thesisPage.css">
</head>

<body>
	<div id="main">
		<div id="right">
			<div id="list">
				<div id="note_list">
					<span>笔记列表<span>
				</div>
				<div id="review_list">
					<span>评论列表<span>
				</div>
			</div>
		</div><!--end of right-->
		<!--left -->
		<div id="left">
			<div id="book_content">
				<div id="book_title">
					<h2><?=$thesis_name?><h2>
				</div>

				<div id="book_list">
					<ul id="book_inerlist">
						<li id="book_name">
							<span>论题:<?=$thesis_name?></span>
						</li>
						<li id="actor">
							<span>作者:<?=$thesis_value['AuthorName']?></span>
						</li>
						<li id="actor">
							<span>作者简介:<?=$thesis_value['AuthorBrief']?></span>
						</li>
						<li id="tag">
							<span>标签:</span>
							<a href="thesislist.php?description=<?=$description['Content']?>"><?=$description['Content']?></a>
						</li>
					</ul>

				</div>
			</div>
			<div id="introduce">
				<span>内容简介</span>
				<pre><?=$thesis_value['Content']?></pre>
			</div>
			
			<?php
			if (isset($_SESSION['currentUser']))
			{
			?>
				<div id="addnote">
					<a href="addNoteForThesis.php?thesis_name=<?=$thesis_name?>">我要写笔记</a>
				</div>
				
				<div id="addcomment">
					<a href="addCommentForThesis.php?thesis_name=<?=$thesis_name?>">我要评论</a>
				</div>
			<?php
			}
			?>
			
			<div id="hasedcomment">
				<span>评论……</span>
				<?php
				while ($comment_value = mysql_fetch_array($comment_values))
				{
				?>
					<div id="each">
						<!--<img src="../images/hxf.jpg" />-->
						<p>评论人：<a href="userPage.php?user_name=<?=$comment_value['Username']?>"><?=$comment_value['Username']?></a></p>
						<pre><?=$comment_value['Content']?></pre>
					</div>
				<?php
				}
				?>
			</div>
			
		</div>
	</div><!--end of main-->
</body>